<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>

  <style>
    .huojian {
      width: 300px;
      position: absolute;
      left: 300px;
      top: 200px;
    }

    /* 调用震动动画 */
    .animation-vibrate {
      animation: vibrate 1s linear 0s infinite alternate;
    }
    /* 定义震动动画 */
    @keyframes vibrate {
      0% {
        transform: translate(-30px, -30px);
      }
      100% {
        transform: translate(30px, 30px);
      }
    }

    .line {
      width: 1px;
      height: 160px;
      background-color: blue;
      position: absolute;
      /* animation: move 1s linear var(--delay) infinite backwards; */
    }
    .pos1 {
      top: 200px;
      left: 400px;
      /* animation: move 1s linear var(--delay) infinite  backwards; */
    }
    .pos2 {
      top: 240px;
      left: 450px;
      /* animation: move 1s linear var(--delay) infinite backwards ; */
    }
    .pos3 {
      top: 290px;
      left: 500px;
      /* animation-fill-mode: backwards; */
      /* animation: move 1s linear var(--delay) infinite backwards; */
    }
    .pos4 {
      top: 320px;
      left: 550px;
      /* animation: move 1s linear var(--delay) infinite backwards; */
    }

    /* 倾斜从上往下移入再移出动画 */
    .animation-move {
      animation: move 1s linear var(--delay) infinite backwards;
    }

    @keyframes move {
      0% {
        opacity: 0;
        transform: rotate(55deg) translateY(-200px);
      }
      100% {
        opacity: 1;
        transform: rotate(55deg) translateY(200px);
      }
    }
  </style>

  <body>
    <!-- 火箭图 -->
    <img src="/src/img/transform/huojian.jpg" class="huojian animation-vibrate" />
    <!-- 气流 -->
    <div class="line pos1 animation-move" style="--delay: 0s"></div>
    <div class="line pos2 animation-move" style="--delay: 0.4s"></div>
    <div class="line pos3 animation-move" style="--delay: 0.6s"></div>
    <div class="line pos4 animation-move" style="--delay: 0.2s"></div>
    <!-- 添加音乐 现代浏览器不支持音频自动播放，所以音频没有效果
         处理方式
         用户进入界面前，让他点击开始按扭，播放音乐，看到游戏画面（需要结合JS实现）
         因为不支持自动播放音乐--所以课上没讲
    -->
    <audio src="./images/huojian.mp3" autoplay loop></audio>
  </body>
</html>
